//
//  LMAlertLabel.m
//  舍品
//
//  Created by 楼 眉 on 16/3/3.
//  Copyright © 2016年 楼 眉. All rights reserved.
//

#import "LMAlertLabel.h"

@implementation LMAlertLabel

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {

    }
    return  self;
}

+ (void)alertLabelWithTarget:(UIViewController *)target title:(NSString *)alertString
{
    LMAlertLabel *alertLabel = [[LMAlertLabel alloc]init];
    [target.view addSubview:alertLabel];
    alertLabel.width = 120;
    alertLabel.height = 33;
    alertLabel.text = alertString;
    alertLabel.center = target.view.center;
    alertLabel.backgroundColor = [UIColor blackColor];
    alertLabel.textAlignment = NSTextAlignmentCenter;
    alertLabel.textColor = [UIColor whiteColor];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [alertLabel removeFromSuperview];
    });
}
@end
